package com.noble.meether.chat.ui.agora.act.bean;

import com.noble.library.base.bean.BaseData;

import org.json.JSONArray;
import org.json.JSONObject;

import java.util.ArrayList;
import java.util.List;

/**
 * 视频中投诉列表
 * Created by Su on 2017/7/27.
 */
public class RtcComplainReasons extends BaseData {
    private List<Complain> report_reasons = new ArrayList<>();            // 视频中举报项

    @Override
    public void parseJson(String jsonStr) {
        JSONArray jsonArray = getJsonArray(jsonStr);
        this.report_reasons = (List<Complain>) getBaseDataList(jsonArray, Complain.class);
    }

    public List<Complain> getReport_reasons() {
        return report_reasons;
    }

    public static class Complain extends BaseData {
        private int id;
        private String reason;

        @Override
        public void parseJson(String jsonStr) {
            JSONObject jsonObject = getJsonObject(jsonStr);
            this.id = jsonObject.optInt("Id");
            this.reason = jsonObject.optString("Name");
        }

        public int getId() {
            return id;
        }

        public String getReason() {
            return reason;
        }
    }
}
